From 7560aa8c09542306b8e099040b3ff35905df7074 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Sun, 18 Sep 2005 21:13:07 +0000 Subject: [PATCH] adding tool to convert changelog into rss --- ChangeLog | 80 +++++++++++++++++--------- docs/tools/changelog2rss | 121 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 175 insertions(+), 26 deletions(-) create mode 100755 docs/tools/changelog2rss diff --git a/ChangeLog b/ChangeLog index 39d5943..cf5c7e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,14 +1,58 @@ 2005-09-18 Øyvind Kolås - * babl/Makefile.am: - * babl/babl-classes.h: - * babl/babl-conversion.c: (each_babl_conversion_destroy), - (conversion_new), (create_name), (babl_conversion_new), - (babl_conversion_process), (test_create), (babl_conversion_error): + * docs/tools/changelog2rss: tool to create RSS feed of ChangeLog. + +2005-09-18 Øyvind Kolås + + * docs/Makefile.am: Included BablFishPath.[html|txt] + * docs/index-static.html.in: included some ramblings about the + background and purpose of babl. + +2005-09-18 Øyvind Kolås + + * tests/Makefile.am: + * tests/babl_fish_path_dhtml.c, + * tests/babl_fish_path_fitness.c: new introspection outputters, that + report on the conversion matrix of BablFishPath. + * tests/babl-html-dump.c: (main): removed conversions, since it is + now used as "Vocabulary" in the documentation,. + * tests/conversions.c: (each_conversion), (main): + * tests/formats.c: (format_check), (main): + * tests/models.c: (model_check), (main): + * tests/types.c: (type_check), (main): Moved the logic into BablCore + in previous commit. + +2005-09-18 Øyvind Kolås + + + Updating test suite, conversion and format quality testing + code folded into babl-core in previous commit. + +2005-09-18 Øyvind Kolås + + * babl/base/model-cmyk.c: (rgb_to_cmyk), (cmyk_to_rgb), + (conversions), (formats): + * babl/base/model-gray.c: (rgba_to_graya), (rgba_to_gray), + (graya_to_rgba), (gray_to_rgba), (conversions): + * babl/base/model-rgb.c: (formats): + * babl/base/model-ycbcr.c: (rgba_to_ycbcra), (rgba_to_ycbcr), + (ycbcra_to_rgba), (ycbcr_to_rgba), (conversions), (formats): + * extensions/CIE-Lab.c: (rgba_to_lab), (lab_to_rgba), + (rgba_to_laba), (laba_to_rgba), (conversions): + * extensions/naive-CMYK.c: (init), (rgba_to_cmyk), (cmyk_to_rgba): + + register linear reference conversions instead, since they can be used + in BablFishPath chains. + +2005-09-18 Øyvind Kolås + + Adding BablFishPath, as well as splittin out Simple and Reference + from babl-fish.c. (lazy commit of large changes :d ) + + * babl/babl-internal.h: * babl/babl-core.c: (rgba_to_rgba), (babl_core_init): * babl/babl-db.c: (babl_db_count): * babl/babl-db.h: - * babl/babl-extension.c: * babl/babl-fish.c: (match_conversion), (babl_conversion_find), (babl_fish_db), (babl_fish), (babl_fish_process), (each_babl_fish_destroy): @@ -18,7 +62,6 @@ * babl/babl-internal.c: (babl_process), (each_conversion), (each_format), (gen_type_format_for_model), (gen_formats_for_model), (babl_extension_post_load): - * babl/babl-internal.h: * babl/babl-introspect.c: (conversion_introspect): * babl/babl-model.c: (babl_model_new), (test_create), (reference_format), (construct_double_format), @@ -26,27 +69,12 @@ * babl/babl-sanity.c: (id_sanity): * babl/babl-type.c: (babl_type_new), (r_interval), (test_init), (double_vector_format), (babl_type_is_symmetric): + +2005-09-18 Øyvind Kolås + + * babl/babl-classes.h: added BablFishPath * babl/babl-util.c: (babl_list_each), (init_ticks), (babl_ticks): * babl/babl-util.h: - * babl/base/model-cmyk.c: (rgb_to_cmyk), (cmyk_to_rgb), - (conversions), (formats): - * babl/base/model-gray.c: (rgba_to_graya), (rgba_to_gray), - (graya_to_rgba), (gray_to_rgba), (conversions): - * babl/base/model-rgb.c: (formats): - * babl/base/model-ycbcr.c: (rgba_to_ycbcra), (rgba_to_ycbcr), - (ycbcra_to_rgba), (ycbcr_to_rgba), (conversions), (formats): - * docs/Makefile.am: - * docs/index-static.html.in: - * extensions/CIE-Lab.c: (rgba_to_lab), (lab_to_rgba), - (rgba_to_laba), (laba_to_rgba), (conversions): - * extensions/Makefile.in: - * extensions/naive-CMYK.c: (init), (rgba_to_cmyk), (cmyk_to_rgba): - * tests/Makefile.am: - * tests/babl-html-dump.c: (main): - * tests/conversions.c: (each_conversion), (main): - * tests/formats.c: (format_check), (main): - * tests/models.c: (model_check), (main): - * tests/types.c: (type_check), (main): 2005-09-18 Øyvind Kolås diff --git a/docs/tools/changelog2rss b/docs/tools/changelog2rss new file mode 100755 index 0000000..6cfc6e5 --- /dev/null +++ b/docs/tools/changelog2rss @@ -0,0 +1,121 @@ +#!/usr/bin/env ruby + +require 'parsedate' + +SITE_TITLE = `pwd`.chomp.split('/').last + +LISTING_TYPE = 0 + +class ChangeLogEntry + attr_accessor :category, :time, :title, :content, :author + + def initialize category = 'foo', + time = Time.now, + title = 'no title', + author = 'no author set', + content = '' + @category = category + @time = time + @title = title + @content = content + @author = author + end + + def to_s + @title+@content + end + + def to_rss + str = "\n" + str += "#{author}, #{time.strftime '%y%m%d'}\n" + str += "#{time.to_s}\n" + str += "#{time.to_s}\n" + str += "#{content}\n" + str += "\n" + end +end + +$newest = Time.now + +class ChangeLog + attr_accessor :entries + attr_reader :title + + def initialize + @entries = Array.new + end + + def load file, title=File.basename(file) + @title = title + + entry = nil + + File.open file do + |file| + file.each_line do + |line| + if line =~ /^(\d\d\d\d-\d\d-\d\d.*) (.*) (.*)/ + @entries.push entry unless entry == nil + date = ParseDate.parsedate $1 + time = Time.mktime date[0], date[1], date[2], date[3] + + entry = ChangeLogEntry.new(title, time, line, $2) + else + entry.content += line unless entry == nil + end + end + + @entries.push entry unless entry == nil + end + end + + def sort! + @entries.reverse! + @entries = @entries.sort { |x,y| (x.time <=> y.time)* -1 } + end + + def to_s + previous_category = 'foo' + str = "A combination of ChangeLogs related to the aluminium platform" + + @entries.each do + |entry| + if entry.category != previous_category + str+="\n\n__"+entry.category + "_"*(78-entry.category.length) + "\n\n" + previous_category = entry.category + end + str += entry.to_s + end + str + end + + def to_rss + previous_category = 'foo' + str = "\n" + str += "\n" + str += "\n" + + str += "\n" + + str += "bazfoo\n" + str += "\n" + + @entries.each do + |entry| + str += entry.to_rss + end + + str += "\n" + str += "\n" + + str + end +end + +changelog = ChangeLog.new +changelog.load ARGV[0] +#changelog.load 'path to another changelog', 'name' + +changelog.sort! + +puts changelog.to_rss -- 2.30.2